{extend name="./template/default/m/pub/base.html" /}
{block name="seo"}
<title>vip-{$site_name}</title>
{/block}
{block name="content"}
{include file="./template/default/m/pub/top3.html" /}
<div style="position: fixed;top: 46px;width: 100%">
    <div class="title-1" >VIP套餐<a href="#" class="title-1-right">推广赢VIP</a></div>
    <ul class="recharge-set">
        {volist name="vips" id="vo"}
        <li data-val="{$vo.price}">
            <div class="recharge-set-info">
                <p class="recharge-set-title">{$vo.desc}</p>
                <p class="recharge-set-tip">每天约￥{:round($vo.price/$vo.day, 2)}</p>
            </div>
            <span class="recharge-set-right"> ￥{$vo.price} </span>
        </li>
        {/volist}
    </ul>
    <div class="title-1">充值方式</div>
    <ul class="recharge-style">
        {volist name="payments" id="vo"}
        <li data-code="{$vo.code}">
            <img class="recharge-style-img" src="/static/images/{$vo.img}.png">
            <div class="recharge-style-info">
                <p class="recharge-style-title">{$vo.title}</p>
            </div>
            <img class="recharge-style-right" src="/static/images/recharge-style-right.png">
        </li>
        {/volist}
        <li>
            <img class="recharge-style-img" src="/static/images/kami.png">
            <div class="recharge-style-info" onclick="location.href = '/kami'">
                <p class="recharge-style-title">购买卡密</p>
            </div>
            <img class="recharge-style-right" src="/static/images/recharge-style-right.png">
        </li>
    </ul>
    <form method="post" id="chargeForm" action="vip">
        <input type="hidden" name="money" id="money" value="">
        <input type="hidden" name="code" id="code">
        <input type="hidden" name="pay_type"  value="1">
    </form>
    <a class="recharge-fix-btn" href="javascript:void(0);" onclick="formSub();">确认开通</a>
    <div class="toast" style="display:none;"></div>
</div>

<script>
    $('.recharge-set li').click(function () {
        $(this).addClass('active').siblings().removeClass('active');
        $('#money').val($(this).attr('data-val'));
    })
    $('.recharge-style li').click(function () {
        $(this).addClass('active').siblings().removeClass('active');
        $('#code').val($(this).attr('data-code'));
    })

    function formSub() {
        var money = $('#money').val();
        if (money == '' || money == undefined){
            ShowDialog('请选择一个vip卡');
        }else {
            $('#chargeForm')[0].submit(function (event) {
                console.log(event);
            });
        }
    }
</script>
{/block}